﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace EzyThirdLogic.ExtensionMethods
{
    public static class LinkedListExtensions
    {
        public static LinkedList<string> Clone(this LinkedList<string> linkedList)
        {
            var clonedLinkedList = new LinkedList<string>();

            foreach (var element in linkedList)
            {
                clonedLinkedList.AddLast(element);
            }

            return clonedLinkedList;
        }

        public static LinkedList<FunctionalDependency> Clone(this LinkedList<FunctionalDependency> linkedList)
        {
            var clonedLinkedList = new LinkedList<FunctionalDependency>();

            foreach (var element in linkedList)
            {
                clonedLinkedList.AddLast(element);
            }

            return clonedLinkedList;
        }

        public static LinkedList<FunctionalDependencySet> Clone(this LinkedList<FunctionalDependencySet> linkedList)
        {
            var clonedLinkedList = new LinkedList<FunctionalDependencySet>();

            foreach (var element in linkedList)
            {
                clonedLinkedList.AddLast(element);
            }

            return clonedLinkedList;
        }

        public static LinkedList<BitArray> Clone(this LinkedList<BitArray> linkedList)
        {
            var clonedLinkedList = new LinkedList<BitArray>();

            foreach (var element in linkedList)
            {
                clonedLinkedList.AddLast(element);
            }

            return clonedLinkedList;
        }
    }
}
